#include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#define MEMSIZE 1024 * 1024
using namespace std;

int main()
{
	int count = 0;
	void *p = NULL;
	while (1)
	{

		p = (void *)malloc(MEMSIZE);

		if (!p)
			break;

		printf("Current allocation %d MB\n", ++count);
	}
}